with open("bill.txt","r+",encoding="UTF-8") as f,open("bill.txt.bak","w",encoding="UTF-8") as f1:
    res=f.read()
    f1.write(res)
    s=""
    for line in res.split("\n"):
        if "测试" not in line:       #find找不到返回-1
            f1.write(line)
        else:
            continue

    f.seek(0)
    f.truncate()
    f.write(s)
